package cn.liyicun.test.controller;

import cn.liyicun.test.dto.MyResultInfo;
import cn.liyicun.test.service.UserFileService;
import cn.liyicun.test.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@Controller
public class UserInfoController extends BaseController {


    @Autowired
    UserService user;

    @RequestMapping("/active_user")
    public String activeUser(HttpServletRequest req, HttpServletResponse res, Model model) throws IOException {
        Long uid = isLogin(req, res, true);
        if (uid <= 0) {
            return null;
        }

        List<Map<String, Object>> list = user.activeUser( );
        model.addAttribute("lists", list);
        return "active_user";
    }


}